package com.xiaobingby.controller.view;

import java.util.List;

/**
 * DataTables数据封装-返回前台
 * Created by XiaoBingBy on 2017/8/10.
 */
public class DataTables<T> {

    private Integer draw;                       //获取Datatables发送的参数 必要 //这个值作者会直接返回给前台

    private Integer recordsTotal;             //必要。即没有过滤的记录数（数据库里总共记录数）

    private Integer recordsFiltered;          //必要。过滤后的记录数（如果有接收到前台的过滤条件，则返回的是过滤后的记录数）

    private List<T> data;                       //data 与datatales 加载的“dataSrc"对应

    private String error;                       //可选。你可以定义一个错误来描述服务器出了问题后的友好提示

    public Integer getDraw() {
        return draw;
    }

    public void setDraw(Integer draw) {
        this.draw = draw;
    }

    public Integer getRecordsTotal() {
        return recordsTotal;
    }

    public void setRecordsTotal(Integer recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    public Integer getRecordsFiltered() {
        return recordsFiltered;
    }

    public void setRecordsFiltered(Integer recordsFiltered) {
        this.recordsFiltered = recordsFiltered;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
